<?php


namespace Xiaoguai\DesignPattern\DP008\Command;


use Xiaoguai\DesignPattern\DP008\CommandInterface;
use Xiaoguai\DesignPattern\DP008\Receiver\Receiver;
use Xiaoguai\DesignPattern\DP008\ReceiverInterface;

class Command implements CommandInterface
{
    /**
     * @var ReceiverInterface $receiver
     */
    protected $receiver;

    public function __construct()
    {
        $this->receiver = new Receiver();
    }

    public function execute()
    {
        return $this->receiver->action();
    }
}